package tools.clustering.isodata;

public class isodata_reduce {

	
	public static void main(String[] args)throws Exception{
		boolean full=true;
		if(args.length<4){
			System.out.println(printHelp());
			System.exit(616);
		}
		if(args[3].equals("half")){
			full=false;
		}else if(args[3].equals("full")){
			full=true;
		}else{
			System.out.println(printHelp());
			System.exit(616);
		}
		isodata i=new isodata(args[0],args[1],args[2],full);
		i.saveDatumToFile(args[4]+"_datum.object");
		
		System.out.println("Done!");
		System.exit(0);
	}
	
	public static String printHelp(){
		String help="Takes an isodata input matrix and reduces it for reclustering\n";
		help+="\treduce <Matrixfile> <Name index file> <subset list> <full/half reduction> <outputPrefix>\n";
		help+="-Matrixfile= The original matrix (textfile)\n";
		help+="-Name index file= translation between row index and names\n";
		help+="-subset list= list of the names that should be in the new file\n";
		help+="-full/half reduction= full if the datum should be shortened. Half if information about the removed points should remain\n";
		help+="-outputPrefix= prefix of the outputfile\n";
		
		return help;
	}
}
